﻿using Furion.DataValidation;
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Furion.CMS.Application.Dto
{
    /// <summary>
    /// 用户创建和更新数据基类
    /// </summary>
    public abstract class BaseUserCreateAndUpdate
    {
        public BaseUserCreateAndUpdate()
        {
            Roles = new List<int>();
            Orgs = new List<Guid>();
        }

        /// <summary>
        /// 昵称
        /// </summary>
        [Required(ErrorMessage = "用户昵称必填")]
        public string NickName { get; set; }
        /// <summary>
        /// 用户头像
        /// </summary>
        public string Avatar { get; set; }
        /// <summary>
        /// 性别
        /// </summary>
        public int Gender { get; set; }
        /// <summary>
        /// 是否启用
        /// </summary>
        public bool Enable { get; set; }
        /// <summary>
        /// 电子邮件
        /// </summary>
        [DataValidation(ValidationTypes.EmailAddress, ErrorMessage = "请输入正确的电子邮件", AllowNullValue = true, AllowEmptyStrings = true)]
        public string Email { get; set; }
        /// <summary>
        /// 手机号
        /// </summary>
        [DataValidation(ValidationTypes.PhoneNumber, ErrorMessage = "请输入正确的手机号码", AllowNullValue = true, AllowEmptyStrings = true)]
        public string PhoneNumber { get; set; }
        /// <summary>
        /// 角色
        /// </summary>
        public List<int> Roles { get; set; }
        /// <summary>
        /// 组织机构
        /// </summary>
        public List<Guid> Orgs { get; set; }
    }
}
